#ifndef MAILCHECKERTHREAD_H
#define MAILCHECKERTHREAD_H

#include <QThread>
#include <QString>
#include <QStringList>
#include <QMutex>

class QTimer;
class MailCheckerThread : public QThread
{
    Q_OBJECT
public:
    MailCheckerThread(QString _playerEmail,QString _password,QString _pop3Server,
        QString _ownerEmail,QObject *parent = NULL);
    ~MailCheckerThread();
    void SetPlayerEmailInfomation(QString _playerEmail,
        QString _password,QString _pop3Server,QString _ownerEmail);
public slots:
    void EnableCheckingThread(bool valid = true);
    void CheckEmail();
private:
    void run();
    QMutex switchMutex;
    QMutex mailInfomationMutex;

    QString playerEmail;
    QString password;
    QString pop3Server;
    QString ownerEmail;

    QString mailUniqueID;
    QTimer *timer;
    volatile bool enable;
signals:
    void NewMediaFileReceived(QStringList fileList);
};

#endif // MAILCHECKERTHREAD_H
